package com.hxy.mapper;


import com.hxy.entity.AuthEmp;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface AuthEmpMapper {
@Select("\tselect  shopemp.empid, shopemp.emploginname,shopemp.emplogincode   ,shopemp.isaccountnonexpired, shopemp.isaccountnonlocked, shopemp.iscredentialsnonexpired, shopemp.isenabled  , shoprole.rolename  , group_concat(shopauthority.name) authority from shop_emp  shopemp\n" +
        "\tleft join  shop_emp_role   shopemprole \n" +
        "\ton shopemp.empid = shopemprole.empid\n" +
        "\tleft join      shop_role  shoprole\n" +
        "\ton  shopemprole.roleid =  shoprole.roleid\n" +
        "\tleft join  shop_role_authority  shoproleauthority\n" +
        "\ton   shoproleauthority.roleid=shoprole.roleid\n" +
        "\tleft join shop_authority  shopauthority\n" +
        "\ton shoproleauthority.authorityid =shopauthority.authorityid \n" +
        "\twhere shopemp.emploginname=#{emploginname} \n" +
        "\t\n")
AuthEmp ListName(@Param("emploginname") String emploginname);

@Select("select shopauthority.name  , group_concat(shopresource.name) resource   from shop_authority   shopauthority\n" +
        "left join shop_authority_resource   shopauthorityresource\n" +
        "on shopauthority.authorityid=shopauthorityresource. authorityid\n" +
        "left join shop_resource   shopresource\n" +
        "on shopauthorityresource.resourceid=shopresource.resourceid\n" +
        "where shopauthority.name=#{authority}")
AuthEmp Listresource(@Param("authority") String authority);



}
